# List  Tuple  Dict       Set
# 列表   元组   字典        集合
# ArrayList   HashMap     Set
# l = [] # 空列表
# print(bool(l)) # False
# # 增 c
# l.append(1)
# l.append("1")
# l.append("True")
# l.append(1.2)
# print(l)
#
# # 查
# print(l[0])
#
# # 删除
# l.remove("True")
# print(l)
# # 改
# l[0] =100
# print(l)

# ---------额外-----------
# l1 = [1, 2, 3]
# l1.insert(0, 99)
# print(l1)
# l1.extend("老王")
# l1.extend([4, 5, 6])  # 拆开 放
# l1.append([4, 5, 6])  # 当作一个整体
# print(l1)

# 索引有负数 最后一个 -1
# l2 = [1,2,3]
# l2.pop(0)
# l2.pop(-1)
# print(l2[-1])
# print(l2)
# 了解
# del l2[0]
# print(l2)

# 功能
l = [4, 6, 5, 5]
# l.clear()
# l2 = l.copy()# 深拷贝
# l2 = l # 浅拷贝
# l.append(7)
# print(l2)
# print(l)

# l.reverse()#反转

# print(l)
# print(l.index(6)) # 返回值索引位置

# l.sort()# 升序
# l.sort(reverse=True)# 降序
# print(l)

# print(l.count(5))

# 公共方法
# l3 = [4,5,6]
# print(sum(l3))
# print(max(l3))
# print(min(l3))
# print(len(l3))

# 遍历
# l = [1, 2, 3, 4, 5, 6, 7, 8, 9]
# for i in l:
#     print(i)

# for i in range(0,len(l)):
#     print(l[i])

# print(9 in l)
# print(9 not in l)

# 切片
l = [1, 2, 3, 4, 5, 6, 7, 8, 9]
# l[start:stop,step]
# start 默认0
# stop
# step 默认1
# print(l[0:4])
# print(l[:4])
# print(l[:4:1])
# print(l[0:4:1])
#
# print(l[0:4:2])

# print(l[-1:-5:-1])
# print(l[-1:-5:-2])

# print(l[::-1]) # 反转


# l = [[1,2,3],[4,5,6],[7,8,9]]
# for i in l:
#     for j in i:
#         print(j)